﻿@model Nop.Plugin.Misc.RFQ.Models.Admin.ConfigurationModel

@{
    Layout = "_ConfigurePlugin";
}

<form asp-controller="RfqAdmin" asp-action="Configure" method="post">
    <section class="content">
        <div class="container-fluid">
            <div class="card card-default">
                <div class="card-body">
                    <div class="form-group row">
                        <div class="col-md-3">
                            <nop-label asp-for="Enabled" />
                        </div>
                        <div class="col-md-9">
                            <nop-editor asp-for="Enabled" />
                            <span asp-validation-for="Enabled"></span>
                        </div>
                    </div>
                    <nop-nested-setting asp-for="Enabled">
                        <div class="form-group row">
                            <div class="col-md-3">
                                <nop-label asp-for="ShowCaptchaOnRequestPage" />
                            </div>
                            <div class="col-md-9">
                                <nop-editor asp-for="ShowCaptchaOnRequestPage" />
                                <span asp-validation-for="ShowCaptchaOnRequestPage"></span>

                                <script asp-location="Footer">
                                    function CheckIsCaptchaEnabled(showCaptchaOnRequestPage)
                                    {
                                        warningValidation('@Url.Action("CheckIsCaptchaEnabled", "RfqAdmin")', '@Html.NameFor(model => model.ShowCaptchaOnRequestPage)', { showCaptchaOnRequestPage:  showCaptchaOnRequestPage});
                                    }

                                    $(function() {
                                        CheckIsCaptchaEnabled($('#@Html.IdFor(m => m.ShowCaptchaOnRequestPage)')[0].checked);

                                        $('#@Html.IdFor(m => m.ShowCaptchaOnRequestPage)').on('change', function() {
                                                CheckIsCaptchaEnabled(this.checked);
                                        });
                                    });
                                </script>
                            </div>
                        </div>
                        <div class="form-group row">
                            <div class="col-md-3">
                                <nop-label asp-for="AllowCustomerGenerateQuotePdf" />
                            </div>
                            <div class="col-md-9">
                                <nop-editor asp-for="AllowCustomerGenerateQuotePdf" />
                                <span asp-validation-for="AllowCustomerGenerateQuotePdf"></span>
                            </div>
                        </div>
                    </nop-nested-setting>
                    <div class="form-group row">
                        <div class="col-md-9 offset-md-3">
                            <input type="submit" name="save" class="btn btn-primary" value="@T("Admin.Common.Save")" />
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
</form>
